home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / DVIM72-Mac 1.9.6 / source / MACHDEFS.H < prev    next >
Encoding:
Text File  |  1992-09-14  |  26.0 KB  |  914 lines  |  [TEXT/R*ch]

  1. /* -*-C-*- machdefs.h */
  2. /*-->machdefs*/
  3. /**********************************************************************/
  4. /****************************** machdefs ******************************/
  5. /**********************************************************************/
  6.  
  7. /***********************************************************************
  8.  
  9. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  10. This file should contain definitions for symbols used for all  operating
  11. system /  implementation  dependencies, and  if  the driver  family  has
  12. already been implemented on  your machine, this should  be the only  file
  13. requiring changes.
  14.  
  15. How to change this file:
  16.     * locate the operating system and implementation definitions;
  17.       they are surrounded by "=====" comment strings.
  18.     * comment out the definitions you do not want, and select the
  19.       ones for your system
  20.     * if adding a new operating system, create a new symbol OS_xxx
  21.       for it and add a new #if OS_xxx ... #endif section for its
  22.       changes.
  23.         * if adding a new implementation for an existing operating
  24.       system, create a new symbol for it and add appropriate
  25.       conditionals inside its #if OS_xxx ... #end section.
  26.     * if you must replace a standard C library function, replace
  27.       instances of its use in the source code with an upper-case
  28.       equivalent (e.g. ungetc --> UNGETC), then define the
  29.       upper-case name below in the generic section, plus the
  30.       operating-system section.
  31.  
  32. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  33.  
  34. List of symbols actually used for #if's [14-Aug-87]
  35.  
  36. Flags and strings:
  37.     ALLOW_INTERRUPT    -- allow interactive interrupt
  38.     ANSI_PROTOTYPES    -- draft ANSI C function prototype declarations are
  39.                supported
  40.     ANSI_LIBRARY    -- draft ANSI C library functions conformance
  41.     ARITHRSHIFT    -- implementation uses arithmetic (not logical) right
  42.                shift
  43.     DVIHELP        -- how to find documentation (for usage())
  44.     DVIPREFIX    -- prefix to standard 3-character extension of output
  45.                and log files
  46.     FASTZERO    -- fast bitmap zeroing by external assembly language
  47.                routine
  48.     FONTLIST    -- font type search list (PK, GF, PXL)
  49.     FONTPATH    -- font directory path
  50.     HIRES        -- high resolution variant of bitmap output
  51.     HOST_WORD_SIZE    -- host integer word size in bits
  52.     MAXOPEN -- maximum number of open files minus six
  53.     PS_MAXWIDTH    -- approximate line width limit for PostScript output
  54.     PS_SHORTLINES    -- shorter output lines in PostScript
  55.     PS_XONXOFFBUG    -- PostScript version 23.0 Xon/Xoff bug workaround
  56.     PXLID        -- TeX PXL file ID
  57.     RB_OPEN        -- fopen() mode flags for binary read
  58.     SEGMEM        -- segmented memory (Intel); bitmap is raster vector
  59.     STDRES        -- standard resolution (200 dpi)
  60.     SUBPATH        -- substitution font file path
  61.     TEXFONTS    -- TeX font file path environment variable
  62.     TEXINPUTS    -- TeX input file path environment variable
  63.     USEGLOBALMAG    -- allow runtime global magnification scaling
  64.     VIRTUAL_FONTS    -- implement virtual font caching
  65.     WB_OPEN        -- fopen() mode flags for binary write
  66.     ZAPTHISOUT    -- remove some obsolete code
  67.  
  68. Alternate library routines  for misfeature workarounds  (these have  the
  69. same names as standard library routines, but upper-cased):
  70.     EXIT
  71.     FOPEN
  72.     FSEEK
  73.     FTELL
  74.     GETENV
  75.     MALLOC(n)
  76.     READ
  77.     REWIND(fp)
  78.     UNGETC
  79.  
  80. C Implementations:
  81.     ATT        -- AT&T Unix (System III, V)
  82.     BSD41        -- Berkeley 4.1BSD
  83.     BSD42        -- Berkeley 4.2BSD
  84.     HPUX        -- HP 9000 series Unix (System V based)
  85.     IBM_PC_LATTICE    -- IBM PC Lattice C compiler
  86.     IBM_PC_MICROSOFT-- IBM PC Microsoft Version 3.x or later C compiler
  87.     IBM_PC_WIZARD    -- IBM PC Wizard C compiler
  88.     KCC_20        -- SRI's KCC Compiler on TOPS-20
  89.     PCC_20        -- Portable C Compiler on TOPS-20
  90.  
  91. Operating systems:
  92.     OS_ATARI    -- Atari 520ST+ TOS (similar to MS DOS)
  93.     OS_PCDOS    -- IBM (and clones) PC DOS and MS DOS
  94.     OS_TOPS20    -- DEC-20 TOPS-20
  95.     OS_UNIX        -- Unix (almost any variant)
  96.     OS_VAXVMS    -- VAX VMS
  97.  
  98. Device names (defined in each DVIxxx.C file):
  99.     APPLEIMAGEWRITER -- Apple ImageWriter printer
  100.     BBNBITGRAPH    -- BBN BitGraph terminal
  101.     CANON_A2    -- Canon LBP-8 A2 laser printer
  102.     DECLA75        -- DEC LA75 printer
  103.     DECLN03PLUS    -- DEC LN03-PLUS laser printer
  104.     EPSON        -- Epson 9-pin family dot-matrix printer
  105.     GOLDENDAWNGL100    -- Golden Dawn GL100 laser printer
  106.     HPJETPLUS    -- Hewlett-Packard Laser Jet Plus (downloaded fonts)
  107.     HPLASERJET    -- Hewlett-Packard Laser Jet (bitmap display)
  108.     IMPRESS        -- imPRESS (IMAGEN laser printer)
  109.     MPISPRINTER    -- MPI Sprinter printer
  110.     OKIDATA2410    -- OKIData 2410 printer
  111.     POSTSCRIPT    -- Adobe PostScript (Apple LaserWriter laser printer)
  112.     PRINTRONIX    -- Printronix (DEC LXY-11, C-Itoh) printer
  113.     TOSHIBAP1351    -- Toshiba P-1351 dot matrix printer
  114.  
  115. ***********************************************************************/
  116.  
  117. /**********************************************************************
  118. Define all symbols for devices, operating systems, and implementations
  119. to be explicitly 0, unless it is expected that they might be set at
  120. compile time.
  121. ***********************************************************************/
  122.  
  123. #define ALLOW_INTERRUPT    0
  124. #define ANSI_PROTOTYPES    0
  125.  
  126. #ifndef ANSI_LIBRARY        /* may be specified at compile time */
  127. #define ANSI_LIBRARY    0
  128. #endif
  129.  
  130. #if    ANSI_LIBRARY
  131. #undef ANSI_PROTOTYPES
  132. #define ANSI_PROTOTYPES    1    /* If library conforms, declarations do too */
  133. #endif
  134.  
  135. #define ARITHRSHIFT    1 /* most C compilers use arithmetic right shift */
  136. #define DISKFULL(fp)    (ferror(fp) && (errno == ENOSPC))
  137. #define DVIEXT        ".dvi"
  138. #define DVIPREFIX    "dvi-"
  139. #define EXIT        exit
  140. #define FASTZERO    0
  141.  
  142. /* The following definitions work for at least PCC-20, BSD 4.2 and  4.3,
  143. and HPUX;  VAX  VMS  has  an extra  level  of  indirection.   Check  the
  144. definition of fileno(fp) in stdio.h; on PCC-20, it is
  145.     #define fileno(p) ((p)->_file)
  146. */
  147. #define FILE_CNT(fp)    (fp)->_cnt
  148. #define FILE_BASE(fp)    (fp)->_base
  149. #define FILE_PTR(fp)    (fp)->_ptr
  150.  
  151. /* #define FONTLIST    0 -- can be set at compile time */
  152. /* #define FONTPATH    0 -- can be set at compile time */
  153.  
  154. #define FOPEN        fopen
  155. #define FSEEK        fseek
  156. #define FTELL        ftell
  157. #define GETENV        getenv
  158. #define HIRES        0
  159. #define MALLOC(n)    malloc(n)
  160. #define MAXDRIFT    2    /* we insist that
  161.                 abs|(hh-pixel_round(h))<=MAXDRIFT| */
  162.  
  163. /* MAXOPEN  should  be 6  less  than the  system  limit on  open  files,
  164. allowing for  files  open  on stdin,  stdout,  stderr,  .dvi,  .dvi-log,
  165. .dvi-xxx, plus MAXOPEN font  files.  It may  be additionally limited  by
  166. the amount of memory available for buffers (e.g. IBM PC). */
  167. #define MAXOPEN        14
  168.  
  169. /* #define PS_MAXWIDTH  72 -- can be set at compile time */
  170.  
  171. /* #define PS_SHORTLINES 0 -- can be set at compile time */
  172.  
  173. #define PS_XONXOFFBUG    0
  174. #define PXLID        0
  175. #define RB_OPEN        "r"
  176.  
  177. /* For virtual font caching to succeed, read() must return the requested
  178. number of bytes, and  preferably do this  with one system   call  and no
  179. double buffering. */
  180.  
  181. #define READ        read
  182.  
  183. /* In  many  implementations, rewind(fp)  is  defined as  equivalent  to
  184. fseek(fp,0L,0).  In  some, however  (e.g.  PCC-20,  and probably  others
  185. based on PCC), it additionally discards input buffer contents, which may
  186. cause unnecessary I/O, and in the case of virtual font caching,   clears
  187. the cache.  Defining  it in  terms of fseek()  should be  okay, but  the
  188. implementation of fseek() should be checked. */
  189.  
  190. #define REWIND(fp)    FSEEK(fp,0L,0)
  191.  
  192. #define SEGMEM        0    /* may be reset by dvixxx for big bitmaps */
  193. #define STDRES        0
  194.  
  195. /* #define SUBPATH    0 -- can be set at compile time */
  196.  
  197. #define SUBEXT        ".sub"
  198. #define SUBNAME        "texfonts"
  199.  
  200. /* #define TEXFONTS    0 -- can be set at compile time */
  201. /* #define TEXINPUTS    0 -- can be set at compile time */
  202.  
  203. #define UNGETC        ungetc
  204. #define USEGLOBALMAG    0
  205. #define WB_OPEN        "w"
  206. #define ZAPTHISOUT    0
  207.  
  208.  
  209. /**********************************************************************/
  210. /* Clear all implementation/operating-system flags--reset later */
  211.  
  212. #define ATT        0    /* define zero or one of these */
  213. #define BSD41        0
  214. #define BSD42        0
  215. #define HPUX        0
  216. #define IBM_PC_LATTICE    0
  217. #define IBM_PC_MICROSOFT    0
  218. #define IBM_PC_WIZARD    0
  219. #define KCC_20        0
  220. #define PCC_20        0
  221.  
  222. #define OS_ATARI    0    /* define one of these */
  223. #define OS_PCDOS    0
  224. #define OS_TOPS20    0
  225. #define OS_UNIX        0
  226. #define OS_VAXVMS    0
  227. #define OS_THINKC    0
  228.  
  229. #define APPLEIMAGEWRITER    0    /* one will be defined by DVIxxx */
  230. #define BBNBITGRAPH    0
  231. #define CANON_A2    0
  232. #define DECLA75        0
  233. #define DECLN03PLUS    0
  234. #define EPSON        0
  235. #define GOLDENDAWNGL100    0
  236. #define HPJETPLUS    0
  237. #define HPLASERJET    0
  238. #define IMPRESS        0
  239. #define MPISPRINTER    0
  240. #define OKIDATA2410    0
  241. #define POSTSCRIPT    0
  242. #define PRINTRONIX    0
  243. #define TOSHIBAP1351    0
  244. #define VIRTUAL_FONTS    0
  245.  
  246.  
  247. /***********************************************************************
  248. Define operating system and implementation  here.  Since these have  all
  249. been explicitly set  to 0  above, we  issue #undef's  to avoid  compiler
  250. macro redefinition warning messages.
  251. ***********************************************************************/
  252.  
  253.  
  254. /*====================
  255. #undef PCC_20
  256. #undef OS_TOPS20
  257. #define PCC_20        1
  258. #define OS_TOPS20    1
  259. ====================*/
  260.  
  261.  
  262. /*====================
  263. #undef KCC_20
  264. #undef OS_TOPS20
  265. #define KCC_20        1
  266. #define OS_TOPS20    1
  267. ====================*/
  268.  
  269.  
  270. /*====================
  271. #undef  OS_ATARI
  272. #define OS_ATARI    1
  273. ====================*/
  274.  
  275. /*====================
  276. #undef  IBM_PC_LATTICE
  277. #undef  OS_PCDOS
  278. #define IBM_PC_LATTICE    1
  279. #define OS_PCDOS    1
  280. ====================*/
  281.  
  282. /*====================
  283. #undef  IBM_PC_MICROSOFT
  284. #undef  OS_PCDOS
  285. #define IBM_PC_MICROSOFT    1
  286. #define OS_PCDOS    1
  287. ====================*/
  288.  
  289. /*====================
  290. #undef  IBM_PC_WIZARD
  291. #undef  OS_PCDOS
  292. #define IBM_PC_WIZARD    1
  293. #define OS_PCDOS    1
  294. ====================*/
  295.  
  296. /*===================
  297. #undef  OS_VAXVMS
  298. #define OS_VAXVMS    1
  299. =====================*/
  300.  
  301. #undef    OS_THINKC
  302. #define    OS_THINKC    1
  303.  
  304. #if    (OS_ATARI | OS_PCDOS | OS_TOPS20 | OS_UNIX | OS_VAXVMS | OS_THINKC)
  305. #else
  306. #undef  OS_UNIX
  307. #define OS_UNIX        1        /* provide default operating system */
  308. #endif
  309.  
  310.  
  311. /**********************************************************************/
  312.  
  313. #if    OS_ATARI
  314.  
  315. #undef  BSD42
  316. #define BSD42        1
  317.  
  318. #undef  DISKFULL
  319. #define DISKFULL(fp)    ferror(fp)
  320.  
  321. #define DVIHELP     "type e:\\tex\\dvi.hlp"
  322.  
  323. #ifdef  FONTLIST     /* can be set at compile time */
  324. #else
  325. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  326. #endif /* FONTLIST */
  327.  
  328. #ifdef FONTPATH         /* can be set at compile time */
  329. #else
  330. #define FONTPATH    "e:\\tex\\fonts\\"
  331. #endif
  332.  
  333. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  334.                 /* signex to pack 8-bit bytes back */
  335.                 /* into integer values, and in dispchar */
  336.                 /* and fillrect for managing character */
  337.                 /* raster storage. */
  338. #define MAXFNAME    64    /* longest host complete filename */
  339.  
  340. #ifndef PS_MAXWIDTH
  341. #define PS_MAXWIDTH    72
  342. #endif
  343.  
  344. #ifndef PS_SHORTLINES
  345. #define PS_SHORTLINES    1
  346. #endif
  347.  
  348. #ifdef SUBPATH            /* can be set at compile time */
  349. #else
  350. #define SUBPATH     "e:\\tex\\inputs\\"
  351. #endif
  352.  
  353. #ifdef TEXINPUTS        /* can be set at compile time */
  354. #else
  355. #define TEXINPUTS    "TEXINPUTS"
  356. #endif
  357.  
  358. #define TEXFONTS    "TEXFONTS"
  359.  
  360. #endif /* OS_ATARI */
  361.  
  362.  
  363. /**********************************************************************/
  364.  
  365. #if    OS_PCDOS
  366.  
  367. #if    IBM_PC_MICROSOFT
  368. #undef ANSI_PROTOTYPES
  369. #define ANSI_PROTOTYPES    1
  370.  
  371. /*
  372. Argument type checking in MSC Version 4.0 is selected by LINT_ARGS.  MSC
  373. Version 5.0 has it selected  by default.  For Version 5.0,  ANSI_LIBRARY
  374. should be defined at compile time  so as to get ANSI-conformant  library
  375. function declarations.  Treating float as double eliminates lots of data
  376. conversion warnings with both Versions 4.0 and 5.0.
  377. */
  378. #define float double    
  379. #define LINT_ARGS    1
  380.  
  381. #undef MALLOC
  382. #define MALLOC(n)    calloc(n,1)
  383. #endif /* IBM_PC_MICROSOFT */
  384.  
  385. #define DVIHELP        "type d:\\tex\\dvi.hlp"
  386.  
  387. #undef DVIPREFIX
  388. #define DVIPREFIX    ""
  389.  
  390. #ifdef FONTLIST        /* can be set at compile time */
  391. #else
  392. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  393. #endif /* FONTLIST */
  394.  
  395. #ifdef FONTPATH            /* can be set at compile time */
  396. #else
  397. #define FONTPATH    "d:\\tex\\fonts\\"
  398. #endif /* FONTPATH */
  399.  
  400. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  401.                 /* signex to pack 8-bit bytes back */
  402.                 /* into integer values, and in dispchar */
  403.                 /* and fillrect for managing character */
  404.                 /* raster storage. */
  405. #define MAXFNAME    64    /* longest host complete filename */
  406.  
  407. #undef MAXOPEN
  408. #define MAXOPEN        5    /* limit on number of open font files */
  409.  
  410. #ifndef PS_MAXWIDTH
  411. #define PS_MAXWIDTH    72
  412. #endif
  413.  
  414. #ifndef PS_SHORTLINES
  415. #define PS_SHORTLINES    1
  416. #endif
  417.  
  418. #undef  RB_OPEN
  419. #define RB_OPEN        "rb"
  420.  
  421. #ifdef SUBPATH            /* can be set at compile time */
  422. #else
  423. #define SUBPATH        "d:\\tex\\inputs\\"
  424. #endif
  425.  
  426. #if    TEXINPUTS        /* can be set at compile time */
  427. #else
  428. #define TEXINPUTS    "TEXINPUTS"
  429. #endif
  430.  
  431. #define TEXFONTS    "TEXFONTS"
  432.  
  433. #if    IBM_PC_MICROSOFT
  434. #undef VIRTUAL_FONTS
  435. #define VIRTUAL_FONTS    1
  436. #endif
  437.  
  438. #undef  WB_OPEN
  439. #define WB_OPEN        "wb"
  440.  
  441. #endif /* OS_PCDOS */
  442.  
  443.  
  444. /***********************************************************************/
  445. #if    OS_TOPS20
  446.  
  447. /************************************************************************
  448. **
  449. **  Adapted for the DEC-20 TOPS-20  operating system with Jay  Lepreau's
  450. **  PCC-20  by  Nelson  H.F.    Beebe,  College  of  Science   Computer,
  451. **  University of Utah, Salt Lake City, UT 84112, Tel: (801) 581-5254.
  452. **
  453. **  The PCC_20 switch is  used to get around  variations on the  DEC-20.
  454. **  The major one is  that text files have  7-bit bytes, while the  .DVI
  455. **  file and the font files have 8-bit bytes.  For the latter, we use  a
  456. **  routine f20open which provides  the necessary interface for  opening
  457. **  with a ddifferent byte size.  PCC-20 follows many other C  compilers
  458. **  in that only the first 8 characters of identifiers are looked at, so
  459. **  massive substitutions  were  necessary  in the  file  commands.h  to
  460. **  shorten the long names there.
  461. **
  462. **  The PCC_20 switch is also used  to get variant font directory  names
  463. **  and to select TOPS-20 jsys  code.  TOPS-20 is a wonderous  operating
  464. **  system with  capabilities far  beyond  most of  its  contemporaries.
  465. **  Like Topsy, it  just grew, and  consequently, its many  capabilities
  466. **  are not  well  integrated.     The terminal  control  jsys'es  (MTOPR,
  467. **  RFMOD, SFMOD, STPAR, RFCOC, SFCOC and TLINK) are particularly poorly
  468. **  done -- RFMOD returns  the JFN mode word,  particular bits of  which
  469. **  must be set by SFMOD,  STPAR, and TLINK.  Why  could there not be  a
  470. **  "return  the  terminal  state"  and  "restore  the  terminal  state"
  471. **  jsys'es?  Some of this  may in fact be  already integrated into  the
  472. **  PCC-20 C run-time library, but since it is totally undocumented  (an
  473. **  all-too common problem with C),  it is essentially unusable in  that
  474. **  form.
  475. **
  476. **  The OS_TOPS20 switch is used in one place to get ioctl.h included at
  477. **  the right point, and in several places to get error messages  output
  478. **  with Tops-20 conventions in  column 1: query  (?)  causes batch  job
  479. **  abort, percent (%) flags a warning.
  480. **
  481. ***********************************************************************/
  482.  
  483. #if    KCC_20
  484. /* KCC wants all #if symbols defined before use. */
  485. #ifndef FONTLIST
  486. #define FONTLIST "PK-GF-PXL"
  487. #endif
  488.  
  489. #ifndef FONTPATH
  490. #define FONTPATH "TEXFONTS:"
  491. #endif
  492.  
  493. #ifndef SUBPATH
  494. #define SUBPATH "TEXINPUTS:"
  495. #endif
  496.  
  497. #ifndef TEXFONTS
  498. #define TEXFONTS "TEXFONTS:"
  499. #endif
  500.  
  501. #ifndef TEXINPUTS
  502. #define TEXINPUTS "TEXINPUTS:"
  503. #endif
  504.  
  505. #undef VIRTUAL_FONTS
  506. #define VIRTUAL_FONTS 0        /* cannot support this yet */
  507.  
  508. #endif
  509.  
  510. #if    KCC_20
  511. #include <local-jsys.h>
  512. /* #include <jsys.h> */
  513. /* KCC-20 and PCC-20  have similar enough JSYS  interfaces that we  just
  514. define values for KCC-20 using PCC-20 names. */
  515. #define JSchfdb    CHFDB
  516. #define JSmtopr    MTOPR
  517. #define JSrfcoc    RFCOC
  518. #define JSrfmod    RFMOD
  519. #define JSsfcoc    SFCOC
  520. #define JSsfmod    SFMOD
  521. #define JSsti    STI
  522. #define JSstpar    STPAR
  523. #define JStlink    TLINK
  524. #define Getmask(name)      ( 1?name )
  525. #define Getshift(name)     ( 0?name )
  526. #define Absmask(name) ( (1?name) << (0?name) )    /* maybe use this one */
  527. #define Value(name)   ( (1?name) << (0?name) )    /* maybe use this one */
  528. #define makefield(name, value)    ( ((value) & Getmask(name)) << Getshift(name) )
  529. #define getfield(var, name)    ( (var) >> Getshift(name) & Getmask(name) )
  530. #define setfield(var, name, value) ( (var) = ((var) & ~Absmask(name)) |\
  531.     makefield(name, value) )
  532. #endif
  533.  
  534. #if    PCC_20
  535. #undef  ARITHRSHIFT
  536. #define ARITHRSHIFT    0    /* PCC-20 uses logical right shift */
  537. #undef  DISKFULL
  538. #define DISKFULL(fp)    ferror(fp)    /* PCC-20 does not always set errno */
  539. #endif
  540.  
  541. #define DVIHELP    "help dvi\nor\ntype hlp:dvi.hlp\nor\nxinfo local clsc dvi"
  542.  
  543. #if    PCC_20
  544. #undef FASTZERO
  545. #define FASTZERO    1    /* for fast assembly language memory zeroing */
  546. #endif
  547.  
  548. #ifdef FONTLIST        /* can be set at compile time */
  549. #else
  550. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  551. #endif /* FONTLIST */
  552.  
  553. #ifdef FONTPATH            /* can be set at compile time */
  554. #else
  555. #define FONTPATH    "/texfonts/"
  556. #endif
  557.  
  558. #undef FOPEN
  559. #define FOPEN        f20open    /* private version for 8-bit binary */
  560.  
  561. #define HOST_WORD_SIZE    36
  562.  
  563. #undef MAXFNAME
  564. #define MAXFNAME    256    /* longest host complete filename */
  565.  
  566. #if    KCC_20
  567. #undef MAXOPEN
  568. #define MAXOPEN        26
  569. #endif
  570.  
  571. #if    PCC_20
  572. #undef MAXOPEN
  573. #define MAXOPEN        14
  574. #endif
  575.  
  576. #ifndef PS_MAXWIDTH
  577. #define PS_MAXWIDTH    72
  578. #endif
  579.  
  580. #ifndef PS_SHORTLINES
  581. #define PS_SHORTLINES    1
  582. #endif
  583.  
  584. #undef  RB_OPEN
  585. #define RB_OPEN        "rb"
  586.  
  587. #if    PCC_20
  588. #undef READ
  589. #define READ        _read    /* fast version with one system call */
  590. #endif
  591.                 /* and single buffering */
  592. #ifdef SUBPATH
  593. #else
  594. #define SUBPATH        "/texinputs/"
  595. #endif
  596.  
  597. #ifdef TEXFONTS            /* can be set at compile time */
  598. #else
  599. #define TEXFONTS    "TEXFONTS"
  600. #endif
  601.  
  602. #ifdef TEXINPUTS        /* can be set at compile time */
  603. #else
  604. #define TEXINPUTS    "TEXINPUTS"
  605. #endif
  606.  
  607. #if    PCC_20
  608. #undef VIRTUAL_FONTS
  609. #define VIRTUAL_FONTS    1
  610. #endif
  611.  
  612. #undef  WB_OPEN
  613. #define WB_OPEN        "wb"
  614.  
  615. /**********************************************************************/
  616. /* The following definitions (down to the endif) are taken from */
  617. /* monsym.h.   It is too big for CPP to handle, so this kludge is */
  618. /* necessary until CPP's tables can be enlarged. */
  619.  
  620. /* selected fields for CHFDB% */
  621. #define CF_nud        01:35-0        /* no update directory */
  622. #define CF_dsp        0777:35-17    /* fdb displacement */
  623. #define CF_jfn        0777777:35-35    /* jfn */
  624.  
  625. #define FBbyv        011        /* retention+bytesize+mode,,# of pages*/
  626. #define FB_ret        077:35-5    /* retention count */
  627.  
  628.  
  629. /* tty mode definitions */
  630.  
  631. #define MOrlw        030        /* read width */
  632. #define MOslw        031        /* set width */
  633. #define MOrll        032        /* read length */
  634. #define MOsll        033        /* set length */
  635.  
  636. #define MOsnt        034        /* set tty non-terminal status */
  637. #define MOsmn        01        /* no system messages(i.e. suppress) */
  638. #define MOsmy        00        /* yes system messages(default) */
  639. #define MOrnt        035        /* read tty non-terminal status */
  640.  
  641. /* fields of jfn mode word */
  642.  
  643. #define TT_osp        01:35-0        /* output suppress */
  644. #define TT_mff        01:35-1        /* mechanical formfeed present */
  645. #define TT_tab        01:35-2        /* mechanical tab present */
  646. #define TT_lca        01:35-3        /* lower case capabilities present */
  647. #define TT_len        0177:35-10    /* page length */
  648. #define TT_wid        0177:35-17    /* page width */
  649. #define TT_wak        017:35-23    /* wakeup field */
  650. #define TT_wk0        01:35-18    /* wakeup class 0 (unused) */
  651. #define TT_ign        01:35-19    /* ignore tt_wak on sfmod */
  652. #define TT_wkf        01:35-20    /* wakeup on formating control chars */
  653. #define TT_wkn        01:35-21    /* wakeup on non-formatting controls */
  654. #define TT_wkp        01:35-22    /* wakeup on punctuation */
  655. #define TT_wka        01:35-23    /* wakeup on alphanumerics */
  656. #define TT_eco        01:35-24    /* echos on */
  657. #define TT_ecm        01:35-25    /* echo mode */
  658. #define TT_alk        01:35-26    /* allow links */
  659. #define TT_aad        01:35-27    /* allow advice (not implemented) */
  660. #define TT_dam        03:35-29    /* data mode */
  661. #define TTbin        00        /* binary */
  662. #define TTasc        01        /* ascii */
  663. #define TTato        02        /* ascii and translate output only */
  664. #define TTate        03        /* ascii and translate echos only */
  665. #define TT_uoc        01:35-30    /* upper case output control */
  666. #define TT_lic        01:35-31    /* lower case input control */
  667. #define TT_dum        03:35-33    /* duplex mode */
  668. #define TTfdx        00        /* full duplex */
  669. #define TT0dx        01        /* not used, reserved */
  670. #define TThdx        02        /* half duplex (character) */
  671. #define TTldx        03        /* line half duplex */
  672. #define TT_pgm        01:35-34    /* page mode */
  673. #define TT_car        01:35-35    /* carrier state */
  674.  
  675. /* tlink */
  676.  
  677. #define TL_cro        01:35-0        /* clear remote to object link */
  678. #define TL_cor        01:35-1        /* clear object to remote link */
  679. #define TL_eor        01:35-2        /* establist object to remote link */
  680. #define TL_ero        01:35-3        /* establish remote to object link */
  681. #define TL_sab        01:35-4        /* set accept bit for object */
  682. #define TL_abs        01:35-5        /* accept bit state */
  683. #define TL_sta        01:35-6        /* set or clear advice */
  684. #define TL_aad        01:35-7        /* accept advice */
  685. #define TL_obj        0777777:35-35    /* object designator */
  686.  
  687. #endif /* OS_TOPS20 */
  688.  
  689. /**********************************************************************/
  690.  
  691. #if    OS_UNIX
  692.  
  693. #undef BSD42
  694. #define BSD42        1        /* want DVISPOOL code in dviterm.h */
  695.  
  696. #define DVIHELP        "man dvi\nor\napropos dvi"
  697.  
  698. #ifdef FONTLIST        /* can be set at compile time */
  699. #else
  700. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  701. #endif /* FONTLIST */
  702.  
  703. #ifdef FONTPATH            /* can be set at compile time */
  704. #else
  705. #define FONTPATH    "/usr/lib/tex/fonts/"
  706. #endif
  707.  
  708. #undef MAXOPEN
  709.  
  710. #if    HPUX
  711. #define MAXFNAME    1024    /* longest host complete filename */
  712. #define MAXOPEN        50
  713. #else  /* NOT HPUX */
  714. #define MAXFNAME    256    /* longest host complete filename */
  715. #define MAXOPEN        14
  716. #endif /* HPUX */
  717.  
  718. #ifndef PS_MAXWIDTH
  719. #define PS_MAXWIDTH    72
  720. #endif
  721.  
  722. #ifndef PS_SHORTLINES
  723. #define PS_SHORTLINES    1       /* some Unix utilities fail with long lines */
  724. #endif
  725.  
  726. #ifdef SUBPATH            /* can be set at compile time */
  727. #else
  728. #define SUBPATH        "/usr/lib/tex/macros/"
  729. #endif
  730.  
  731. #if    TEXINPUTS        /* can be set at compile time */
  732. #else
  733. #define TEXINPUTS    "TEXINPUTS"
  734. #endif
  735.  
  736. #if    TEXFONTS            /* can be set at compile time */
  737. #else
  738. #define TEXFONTS    "TEXFONTS"
  739. #endif
  740.  
  741. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  742.                 /* signex to pack 8-bit bytes back */
  743.                 /* into integer values, and in dispchar */
  744.                 /* and fillrect for managing character */
  745.                 /* raster storage. */
  746. #endif /* OS_UNIX */
  747.  
  748.  
  749. /**********************************************************************/
  750.  
  751. #if    OS_VAXVMS
  752.  
  753. /***********************************************************************
  754. ** Several standard Unix library functions do not work properly with VMS
  755. ** C, or are not implemented:
  756. **
  757. **    exit()        -- wrong conventions for return code
  758. **    fseek()        -- fails on record-oriented files
  759. **    ftell()        -- fails on record-oriented files
  760. **    getchar()    -- waits for <CR> to be typed
  761. **    getenv()    -- colon- and case-sensitive
  762. **    getlogin()    -- not implemented
  763. **    qsort()        -- not implemented
  764. **    tell()        -- not implemented
  765. **    ungetc()    -- fails for any character with high-order bit set
  766. **    unlink()    -- not implemented (equivalent available)
  767. **
  768. ** The  file  VAXVMS.C  contains   workarounds;  it  must  be   compiled
  769. ** separately and loaded with each of the DVI drivers.
  770. ***********************************************************************/
  771.  
  772. #include <jpidef.h>        /* need for getjpi() in openfont() */
  773.  
  774. #define DVIHELP        "help dvi\nor\ntype tex_inputs:dvi.hlp"
  775. #define EXIT        vms_exit
  776.  
  777. #define FILE_CNT(fp)    (*fp)->_cnt
  778. #define FILE_BASE(fp)    (*fp)->_base
  779. #define FILE_PTR(fp)    (*fp)->_ptr
  780.  
  781. #ifndef FONTLIST        /* can be set at compile time */
  782. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  783. #endif /* FONTLIST */
  784.  
  785. #ifndef FONTPATH        /* can be set at compile time */
  786. #define FONTPATH    "TEX_FONTS:" /* Kellerman & Smith VMS TeX */
  787. #endif /* FONTPATH */
  788.  
  789. #define FSEEK        vms_fseek
  790. #define FTELL        vms_ftell
  791. #define GETENV        vms_getenv
  792. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  793.                 /* signex to pack 8-bit bytes back */
  794.                 /* into integer values, and in dispchar */
  795.                 /* and fillrect for managing character */
  796.                 /* raster storage. */
  797.  
  798. #define MAXFNAME    256    /* longest host complete filename */
  799.  
  800. #undef MAXOPEN
  801. #define MAXOPEN        14
  802.  
  803. #undef  RB_OPEN
  804. #define RB_OPEN        "rb"
  805.  
  806. #ifndef PS_MAXWIDTH
  807. #define PS_MAXWIDTH    72
  808. #endif
  809.  
  810. #ifndef  PS_SHORTLINES
  811. #define PS_SHORTLINES    1       /* VMS has trouble with long lines */
  812. #endif
  813.  
  814. #define READ        vms_read /* ordinary read() returns only one disk */
  815.                 /* at each call */
  816.  
  817. #ifndef SUBPATH            /* can be set at compile time */
  818. #define SUBPATH        "TEX_INPUTS:" /* Kellerman & Smith VMS TeX */
  819. #endif
  820.  
  821. #ifndef TEXINPUTS        /* can be set at compile time */
  822. #define TEXINPUTS    "TEX_INPUTS:"
  823. #endif
  824.  
  825. #ifndef TEXFONTS        /* can be set at compile time */
  826. #define TEXFONTS    "TEX_FONTS:"
  827. #endif
  828.  
  829. #define UNGETC        vms_ungetc
  830.  
  831. /* VIRTUAL_FONTS cannot be implemented  yet.  The code  works, but the
  832. calls to FSEEK() (vms_seek) result in _filbuf() being called to refill
  833. the buffer, obviating the pre-buffering.  Additional code in case 0 of
  834. vms_seek() can probably be developed to avoid this, but I have run out
  835. of time for now. */
  836.  
  837. #undef  WB_OPEN
  838. #define WB_OPEN        "wb"
  839.  
  840. #endif /* OS_VAXVMS */
  841.  
  842. /**********************************************************************/
  843.  
  844. #if    OS_THINKC
  845.  
  846. /**********************************************************************/
  847. #undef BSD42
  848. #define BSD42        0        /* don't want DVISPOOL code in dviterm.h */
  849.  
  850. #undef ANSI_LIBRARY
  851. #define ANSI_LIBRARY 1
  852.  
  853. #if    ANSI_LIBRARY
  854. #undef ANSI_PROTOTYPES
  855. #define ANSI_PROTOTYPES    1    /* If library conforms, declarations do too */
  856. #endif
  857.  
  858. #define DVIHELP        "huh?"
  859.  
  860. #ifdef FONTLIST        /* can be set at compile time */
  861. #else
  862. #define FONTLIST    "PK-PK-PK"    /* preferred search order */
  863. #endif /* FONTLIST */
  864.  
  865. #ifdef FONTPATH            /* can be set at compile time */
  866. #else
  867. #define FONTPATH    "DD80:OzTeX:PK-files"
  868. #endif /* FONTPATH */
  869.  
  870. #undef GETENV
  871. #define GETENV *get_str_resource
  872.  
  873. #undef MAXOPEN
  874.  
  875. #define MAXFNAME    255    /* longest host complete filename */
  876. #define MAXOPEN        8
  877.  
  878. #ifndef PS_MAXWIDTH
  879. #define PS_MAXWIDTH    72
  880. #endif
  881.  
  882. #ifndef PS_SHORTLINES
  883. #define PS_SHORTLINES    1       /* some Unix utilities fail with long lines */
  884. #endif
  885.  
  886. #define SUBPATH        "SUBPATH"
  887.  
  888. #undef  RB_OPEN
  889. #define RB_OPEN        "rb"
  890. #undef  WB_OPEN
  891. #define WB_OPEN        "wb"
  892.  
  893. #define TEXINPUTS    "TEXINPUTS"
  894.  
  895. #define TEXFONTS    "TEXFONTS"
  896.  
  897. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  898.                 /* signex to pack 8-bit bytes back */
  899.                 /* into integer values, and in dispchar */
  900.                 /* and fillrect for managing character */
  901.                 /* raster storage. */
  902.  
  903. #undef  MALLOC
  904. #define MALLOC(n)  sillymalloc(n)
  905. Ptr My_NewPtr( Size logicalSize );
  906. #define free(p)    My_DisposPtr(p)
  907. void My_DisposPtr( void *p );
  908.  
  909. #define        printf    TD_printf
  910.  
  911. #endif /* OS_THINKC */
  912.  
  913. /**********************************************************************/
  914.